/*
 * factorial.c  calculate n factorial.
*/

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *agrv[])
{
	unsigned int factorial;
	unsigned long  sum;
	unsigned int i;
	
	sum = 1;

	printf("please input factorial\n");
	scanf("%d", &factorial);

	for (i = 1; i < factorial + 1; i++)
		sum = sum * i;

	printf("sum=%ld\n", sum);
	
	return 0;
}
